import Vue from 'vue'
import VueRouter from 'vue-router'
//import baiduApi from '@/compotens/baiduApi'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: () => import('@/views/layout/layout'),
    redirect: '/home ',
    children: [
      {
        path: '/home ',
        component: () => import('@/views/home')
      },
      {
        path: 'sertch',
        component: () => import('@/views/seatch')
      },
      {
        path: 'registe',
        component: () => import('@/views/registe')
      },
      {
        path: 'my',
        component: () => import('@/views/my')
      }
    ]
  },
  {
    name: 'login',
    path: '/login',
    component: () => import('@/views/login')
  },
  {
    name: 'zhuce',
    path: '/zhuce',
    component: () => import('@/views/zhuce')
  },
  {
    path: '/city',
    component: () => import('@/views/chengshi')
  },
  {
    path: '/map',
    component: () => import('@/views/home/componten/baiduApi')
  },
  {
    path: '/add',
    component: () => import('@/views/home/componten/add')
  }
]

const router = new VueRouter({
  routes
})

export default router
